<!DOCTYPE html>
<html lang="en-us">
  <head>

    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    
<meta charset="UTF-8">
<title>Update anomaly detection jobs API | Elasticsearch Guide [7.7] | Elastic</title>
<link rel="home" href="index.html" title="Elasticsearch Guide [7.7]">
<link rel="up" href="ml-apis.html" title="Machine learning anomaly detection APIs">
<link rel="prev" href="ml-update-filter.html" title="Update filter API">
<link rel="next" href="ml-update-snapshot.html" title="Update model snapshots API">
<meta name="DC.type" content="Learn/Docs/Elasticsearch/Reference/7.7">
<meta name="DC.subject" content="Elasticsearch">
<meta name="DC.identifier" content="7.7">
<meta name="robots" content="noindex,nofollow">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script src="https://cdn.optimizely.com/js/18132920325.js"></script>
    <link rel="apple-touch-icon" sizes="57x57" href="/apple-icon-57x57.png">
    <link rel="apple-touch-icon" sizes="60x60" href="/apple-icon-60x60.png">
    <link rel="apple-touch-icon" sizes="72x72" href="/apple-icon-72x72.png">
    <link rel="apple-touch-icon" sizes="76x76" href="/apple-icon-76x76.png">
    <link rel="apple-touch-icon" sizes="114x114" href="/apple-icon-114x114.png">
    <link rel="apple-touch-icon" sizes="120x120" href="/apple-icon-120x120.png">
    <link rel="apple-touch-icon" sizes="144x144" href="/apple-icon-144x144.png">
    <link rel="apple-touch-icon" sizes="152x152" href="/apple-icon-152x152.png">
    <link rel="apple-touch-icon" sizes="180x180" href="/apple-icon-180x180.png">
    <link rel="icon" type="image/png" href="/favicon-32x32.png" sizes="32x32">
    <link rel="icon" type="image/png" href="/android-chrome-192x192.png" sizes="192x192">
    <link rel="icon" type="image/png" href="/favicon-96x96.png" sizes="96x96">
    <link rel="icon" type="image/png" href="/favicon-16x16.png" sizes="16x16">
    <link rel="manifest" href="/manifest.json">
    <meta name="apple-mobile-web-app-title" content="Elastic">
    <meta name="application-name" content="Elastic">
    <meta name="msapplication-TileColor" content="#ffffff">
    <meta name="msapplication-TileImage" content="/mstile-144x144.png">
    <meta name="theme-color" content="#ffffff">
    <meta name="naver-site-verification" content="936882c1853b701b3cef3721758d80535413dbfd">
    <meta name="yandex-verification" content="d8a47e95d0972434">
    <meta name="localized" content="true">
    <meta name="st:robots" content="follow,index">
    <meta property="og:image" content="https://www.elastic.co/static/images/elastic-logo-200.png">
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
    <link rel="icon" href="/favicon.ico" type="image/x-icon">
    <link rel="apple-touch-icon-precomposed" sizes="64x64" href="/favicon_64x64_16bit.png">
    <link rel="apple-touch-icon-precomposed" sizes="32x32" href="/favicon_32x32.png">
    <link rel="apple-touch-icon-precomposed" sizes="16x16" href="/favicon_16x16.png">
    <!-- Give IE8 a fighting chance -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="/guide/static/styles.css">
  </head>

  <!--© 2015-2021 Elasticsearch B.V. Copying, publishing and/or distributing without written permission is strictly prohibited.-->

  <body>
    <!-- Google Tag Manager -->
    <script>dataLayer = [];</script><noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-58RLH5" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
    <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= '//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','GTM-58RLH5');</script>
    <!-- End Google Tag Manager -->

    <!-- Global site tag (gtag.js) - Google Analytics -->
    <script async src="https://www.googletagmanager.com/gtag/js?id=UA-12395217-16"></script>
    <script>
      window.dataLayer = window.dataLayer || [];
      function gtag(){dataLayer.push(arguments);}
      gtag('js', new Date());
      gtag('config', 'UA-12395217-16');
    </script>

    <!--BEGIN QUALTRICS WEBSITE FEEDBACK SNIPPET-->
    <script type="text/javascript">
      (function(){var g=function(e,h,f,g){
      this.get=function(a){for(var a=a+"=",c=document.cookie.split(";"),b=0,e=c.length;b<e;b++){for(var d=c[b];" "==d.charAt(0);)d=d.substring(1,d.length);if(0==d.indexOf(a))return d.substring(a.length,d.length)}return null};
      this.set=function(a,c){var b="",b=new Date;b.setTime(b.getTime()+6048E5);b="; expires="+b.toGMTString();document.cookie=a+"="+c+b+"; path=/; "};
      this.check=function(){var a=this.get(f);if(a)a=a.split(":");else if(100!=e)"v"==h&&(e=Math.random()>=e/100?0:100),a=[h,e,0],this.set(f,a.join(":"));else return!0;var c=a[1];if(100==c)return!0;switch(a[0]){case "v":return!1;case "r":return c=a[2]%Math.floor(100/c),a[2]++,this.set(f,a.join(":")),!c}return!0};
      this.go=function(){if(this.check()){var a=document.createElement("script");a.type="text/javascript";a.src=g;document.body&&document.body.appendChild(a)}};
      this.start=function(){var a=this;window.addEventListener?window.addEventListener("load",function(){a.go()},!1):window.attachEvent&&window.attachEvent("onload",function(){a.go()})}};
      try{(new g(100,"r","QSI_S_ZN_emkP0oSe9Qrn7kF","https://znemkp0ose9qrn7kf-elastic.siteintercept.qualtrics.com/WRSiteInterceptEngine/?Q_ZID=ZN_emkP0oSe9Qrn7kF")).start()}catch(i){}})();
    </script><div id="ZN_emkP0oSe9Qrn7kF"><!--DO NOT REMOVE-CONTENTS PLACED HERE--></div>
    <!--END WEBSITE FEEDBACK SNIPPET-->

    <div id="elastic-nav" style="display:none;"></div>
    <script src="https://www.elastic.co/elastic-nav.js"></script>

    <!-- Subnav -->
    <div>
      <div>
        <div class="tertiary-nav d-none d-md-block">
          <div class="container">
            <div class="p-t-b-15 d-flex justify-content-between nav-container">
              <div class="breadcrum-wrapper"><span><a href="/guide/" style="font-size: 14px; font-weight: 600; color: #000;">Docs</a></span></div>
            </div>
          </div>
        </div>
      </div>
    </div>

    <div class="main-container">
      <section id="content">
        <div class="content-wrapper">

          <section id="guide" lang="en">
            <div class="container">
              <div class="row">
                <div class="col-xs-12 col-sm-8 col-md-8 guide-section">
                  <!-- start body -->
                  <div class="page_header">
<strong>IMPORTANT</strong>: No additional bug fixes or documentation updates
will be released for this version. For the latest information, see the
<a href="../current/index.html">current release documentation</a>.
</div>
<div id="content">
<div class="breadcrumbs">
<span class="breadcrumb-link"><a href="index.html">Elasticsearch Guide [7.7]</a></span>
»
<span class="breadcrumb-link"><a href="rest-apis.html">REST APIs</a></span>
»
<span class="breadcrumb-link"><a href="ml-apis.html">Machine learning anomaly detection APIs</a></span>
»
<span class="breadcrumb-node">Update anomaly detection jobs API</span>
</div>
<div class="navheader">
<span class="prev">
<a href="ml-update-filter.html">« Update filter API</a>
</span>
<span class="next">
<a href="ml-update-snapshot.html">Update model snapshots API »</a>
</span>
</div>
<div class="section xpack">
<div class="titlepage"><div><div>
<h2 class="title">
<a id="ml-update-job"></a>Update anomaly detection jobs API<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/ml/anomaly-detection/apis/update-job.asciidoc">edit</a><a class="xpack_tag" href="/subscriptions"></a>
</h2>
</div></div></div>

<p>Updates certain properties of an anomaly detection job.</p>
<div class="section">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="ml-update-job-request"></a>Request<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/ml/anomaly-detection/apis/update-job.asciidoc">edit</a>
</h3>
</div></div></div>
<p><code class="literal">POST _ml/anomaly_detectors/&lt;job_id&gt;/_update</code></p>
</div>

<div class="section">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="ml-update-job-prereqs"></a>Prerequisites<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/ml/anomaly-detection/apis/update-job.asciidoc">edit</a>
</h3>
</div></div></div>
<div class="ulist itemizedlist">
<ul class="itemizedlist">
<li class="listitem">
If the Elasticsearch security features are enabled, you must have <code class="literal">manage_ml</code> or
<code class="literal">manage</code> cluster privileges to use this API. See
<a class="xref" href="security-privileges.html" title="Security privileges">Security privileges</a>.
</li>
</ul>
</div>
</div>

<div class="section">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="ml-update-job-path-parms"></a>Path parameters<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/ml/anomaly-detection/apis/update-job.asciidoc">edit</a>
</h3>
</div></div></div>
<div class="variablelist">
<dl class="variablelist">
<dt>
<span class="term">
<code class="literal">&lt;job_id&gt;</code>
</span>
</dt>
<dd>
(Required, string)
Identifier for the anomaly detection job.
</dd>
</dl>
</div>
</div>

<div class="section child_attributes">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="ml-update-job-request-body"></a>Request body<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/ml/anomaly-detection/apis/update-job.asciidoc">edit</a>
</h3>
</div></div></div>
<p>The following properties can be updated after the job is created:</p>
<div class="variablelist">
<dl class="variablelist">
<dt>
<span class="term">
<code class="literal">allow_lazy_open</code>
</span>
</dt>
<dd>
<p>
(boolean)
Advanced configuration option. Specifies whether this job can open when there is
insufficient machine learning node capacity for it to be immediately assigned to a node. The
default value is <code class="literal">false</code>; if a machine learning node with capacity to run the job cannot
immediately be found, the <a class="xref" href="ml-open-job.html" title="Open anomaly detection jobs API">open anomaly detection jobs API</a> returns an
error. However, this is also subject to the cluster-wide
<code class="literal">xpack.ml.max_lazy_ml_nodes</code> setting; see <a class="xref" href="ml-settings.html#advanced-ml-settings" title="Advanced machine learning settings">Advanced machine learning settings</a>. If this
option is set to <code class="literal">true</code>, the <a class="xref" href="ml-open-job.html" title="Open anomaly detection jobs API">open anomaly detection jobs API</a> does not
return an error and the job waits in the <code class="literal">opening</code> state until sufficient machine learning
node capacity is available.
</p>
<div class="note admon">
<div class="icon"></div>
<div class="admon_content">
<p>If the job is open when you make the update, you must stop the datafeed,
close the job, then reopen the job and restart the datafeed for the changes to take effect.</p>
</div>
</div>
</dd>
<dt>
<span class="term">
<a id="update-analysislimits"></a><code class="literal">analysis_limits</code>
</span>
</dt>
<dd>
<p>
(Optional, object)
Limits can be applied for the resources required to hold the mathematical models
in memory. These limits are approximate and can be set per job. They do not
control the memory used by other processes, for example the Elasticsearch Java processes.
</p>
<details open>
<summary class="title">Properties of <code class="literal">analysis_limits</code></summary>
<div class="content">
<div class="variablelist">
<dl class="variablelist">
<dt>
<span class="term">
<code class="literal">model_memory_limit</code>
</span>
</dt>
<dd>
<p>
(long or string)
The approximate maximum amount of memory resources that are required for
analytical processing. Once this limit is approached, data pruning becomes
more aggressive. Upon exceeding this limit, new entities are not modeled. The
default value for jobs created in version 6.1 and later is <code class="literal">1024mb</code>.
This value will need to be increased for jobs that are expected to analyze high
cardinality fields, but the default is set to a relatively small size to ensure
that high resource usage is a conscious decision. The default value for jobs
created in versions earlier than 6.1 is <code class="literal">4096mb</code>.
</p>
<p>If you specify a number instead of a string, the units are assumed to be MiB.
Specifying a string is recommended for clarity. If you specify a byte size unit
of <code class="literal">b</code> or <code class="literal">kb</code> and the number does not equate to a discrete number of megabytes,
it is rounded down to the closest MiB. The minimum valid value is 1 MiB. If you
specify a value less than 1 MiB, an error occurs. For more information about
supported byte size units, see <a class="xref" href="common-options.html#byte-units" title="Byte size units">Byte size units</a>.</p>
<p>If your <code class="literal">elasticsearch.yml</code> file contains an <code class="literal">xpack.ml.max_model_memory_limit</code>
setting, an error occurs when you try to create jobs that have
<code class="literal">model_memory_limit</code> values greater than that setting. For more information,
see <a class="xref" href="ml-settings.html" title="Machine learning settings in Elasticsearch">Machine learning settings</a>.</p>
<div class="note admon">
<div class="icon"></div>
<div class="admon_content">
<p>You can update the <code class="literal">analysis_limits</code> only while the job is closed. The
<code class="literal">model_memory_limit</code> property value cannot be decreased below the current usage.</p>
</div>
</div>
<div class="tip admon">
<div class="icon"></div>
<div class="admon_content">
<p>If the <code class="literal">memory_status</code> property in the
<a class="xref" href="ml-get-snapshot.html#ml-get-snapshot-results" title="Response body"><code class="literal">model_size_stats</code> object</a> has a value of
<code class="literal">hard_limit</code>,mthis means that it was unable to process some data. You might want
to re-run the job with an increased <code class="literal">model_memory_limit</code>.</p>
</div>
</div>
</dd>
</dl>
</div>
</div>
</details>
</dd>
<dt>
<span class="term">
<code class="literal">background_persist_interval</code>
</span>
</dt>
<dd>
<p>
(<a class="xref" href="common-options.html#time-units" title="Time units">time units</a>)
Advanced configuration option. The time between each periodic persistence of the
model. The default value is a randomized value between 3 to 4 hours, which
avoids all jobs persisting at exactly the same time. The smallest allowed value
is 1 hour.
</p>
<div class="tip admon">
<div class="icon"></div>
<div class="admon_content">
<p>For very large models (several GB), persistence could take 10-20 minutes,
so do not set the <code class="literal">background_persist_interval</code> value too low.</p>
</div>
</div>
<div class="note admon">
<div class="icon"></div>
<div class="admon_content">
<p>If the job is open when you make the update, you must stop the datafeed,
close the job, then reopen the job and restart the datafeed for the changes to take effect.</p>
</div>
</div>
</dd>
<dt>
<span class="term">
<a id="update-customsettings"></a><code class="literal">custom_settings</code>
</span>
</dt>
<dd>
(object)
Advanced configuration option. Contains custom meta data about the job. For
example, it can contain custom URL information as shown in
<a href="/guide/en/machine-learning/7.7/ml-configuring-url.html" class="ulink" target="_top">Adding custom URLs to machine learning results</a>.
</dd>
<dt>
<span class="term">
<code class="literal">description</code>
</span>
</dt>
<dd>
(string) A description of the job.
</dd>
</dl>
</div>
<div class="variablelist">
<dl class="variablelist">
<dt>
<span class="term">
<code class="literal">detectors</code>
</span>
</dt>
<dd>
<p>
(array) An array of detector update objects.
</p>
<details open>
<summary class="title">Properties of <code class="literal">detectors</code></summary>
<div class="content">
<div class="variablelist">
<dl class="variablelist">
<dt>
<span class="term">
<code class="literal">custom_rules</code>
</span>
</dt>
<dd>
<p>
(array)
An array of custom rule objects, which enable you to customize the way detectors
operate. For example, a rule may dictate to the detector conditions under which
results should be skipped. For more examples, see
<a href="/guide/en/machine-learning/7.7/ml-configuring-detector-custom-rules.html" class="ulink" target="_top">Customizing detectors with custom rules</a>.
</p>
<details open>
<summary class="title">Properties of <code class="literal">custom_rules</code></summary>
<div class="content">
<div class="variablelist">
<dl class="variablelist">
<dt>
<span class="term">
<code class="literal">actions</code>
</span>
</dt>
<dd>
<p>
(array)
The set of actions to be triggered when the rule applies. If
more than one action is specified the effects of all actions are combined. The
available actions include:
</p>
<div class="ulist itemizedlist">
<ul class="itemizedlist">
<li class="listitem">
<code class="literal">skip_result</code>: The result will not be created. This is the default value.
Unless you also specify <code class="literal">skip_model_update</code>, the model will be updated as usual
with the corresponding series value.
</li>
<li class="listitem">
<code class="literal">skip_model_update</code>: The value for that series will not be used to update the
model. Unless you also specify <code class="literal">skip_result</code>, the results will be created as
usual. This action is suitable when certain values are expected to be
consistently anomalous and they affect the model in a way that negatively
impacts the rest of the results.
</li>
</ul>
</div>
</dd>
</dl>
</div>
<div class="variablelist">
<dl class="variablelist">
<dt>
<span class="term">
<code class="literal">conditions</code>
</span>
</dt>
<dd>
<p>
(array)
An optional array of numeric conditions when the rule applies. A rule must
either have a non-empty scope or at least one condition. Multiple conditions are
combined together with a logical <code class="literal">AND</code>. A condition has the following
properties:
</p>
<details open>
<summary class="title">Properties of <code class="literal">conditions</code></summary>
<div class="content">
<div class="variablelist">
<dl class="variablelist">
<dt>
<span class="term">
<code class="literal">applies_to</code>
</span>
</dt>
<dd>
(string)
Specifies the result property to which the condition applies. The available
options are <code class="literal">actual</code>, <code class="literal">typical</code>, <code class="literal">diff_from_typical</code>, <code class="literal">time</code>. If your detector
uses <code class="literal">lat_long</code>, <code class="literal">metric</code>, <code class="literal">rare</code>, or <code class="literal">freq_rare</code> functions, you can only
specify conditions that apply to <code class="literal">time</code>.
</dd>
<dt>
<span class="term">
<code class="literal">operator</code>
</span>
</dt>
<dd>
(string)
Specifies the condition operator. The available options are <code class="literal">gt</code> (greater than),
<code class="literal">gte</code> (greater than or equals), <code class="literal">lt</code> (less than) and <code class="literal">lte</code> (less than or
equals).
</dd>
<dt>
<span class="term">
<code class="literal">value</code>
</span>
</dt>
<dd>
(double)
The value that is compared against the <code class="literal">applies_to</code> field using the <code class="literal">operator</code>.
</dd>
</dl>
</div>
</div>
</details>
</dd>
</dl>
</div>
<div class="variablelist">
<dl class="variablelist">
<dt>
<span class="term">
<code class="literal">scope</code>
</span>
</dt>
<dd>
<p>
(object)
An optional scope of series where the rule applies. A rule must either
have a non-empty scope or at least one condition. By default, the scope includes
all series. Scoping is allowed for any of the fields that are also specified in
<code class="literal">by_field_name</code>, <code class="literal">over_field_name</code>, or <code class="literal">partition_field_name</code>. To add a scope
for a field, add the field name as a key in the scope object and set its value
to an object with the following properties:
</p>
<details open>
<summary class="title">Properties of <code class="literal">scope</code></summary>
<div class="content">
<div class="variablelist">
<dl class="variablelist">
<dt>
<span class="term">
<code class="literal">filter_id</code>
</span>
</dt>
<dd>
(string)
The id of the filter to be used.
</dd>
<dt>
<span class="term">
<code class="literal">filter_type</code>
</span>
</dt>
<dd>
(string)
Either <code class="literal">include</code> (the rule applies for values in the filter) or <code class="literal">exclude</code> (the
rule applies for values not in the filter). Defaults to <code class="literal">include</code>.
</dd>
</dl>
</div>
</div>
</details>
</dd>
</dl>
</div>
</div>
</details>
</dd>
<dt>
<span class="term">
<code class="literal">description</code>
</span>
</dt>
<dd>
(string)
A description of the detector. For example, <code class="literal">Low event rate</code>.
</dd>
<dt>
<span class="term">
<code class="literal">detector_index</code>
</span>
</dt>
<dd>
<p>
(integer)
A unique identifier for the detector. This identifier is based on the order of
the detectors in the <code class="literal">analysis_config</code>, starting at zero.
</p>
<p>If you want to update a specific detector, you must use this identifier. You
cannot, however, change the <code class="literal">detector_index</code> value for a detector.</p>
</dd>
</dl>
</div>
</div>
</details>
</dd>
<dt>
<span class="term">
<code class="literal">groups</code>
</span>
</dt>
<dd>
(array of strings)
A list of job groups. A job can belong to no groups or many.
</dd>
</dl>
</div>
<div class="variablelist">
<dl class="variablelist">
<dt>
<span class="term">
<code class="literal">model_plot_config</code>
</span>
</dt>
<dd>
<p>
(object)
This advanced configuration option stores model information along with the
results. It provides a more detailed view into anomaly detection.
</p>
<div class="warning admon">
<div class="icon"></div>
<div class="admon_content">
<p>If you enable model plot it can add considerable overhead to the
performance of the system; it is not feasible for jobs with many entities.</p>
</div>
</div>
<p>Model plot provides a simplified and indicative view of the model and its
bounds. It does not display complex features such as multivariate correlations
or multimodal data. As such, anomalies may occasionally be reported which cannot
be seen in the model plot.</p>
<p>Model plot config can be configured when the job is created or updated later. It
must be disabled if performance issues are experienced.</p>
<details open>
<summary class="title">Properties of <code class="literal">model_plot_config</code></summary>
<div class="content">
<div class="variablelist">
<dl class="variablelist">
<dt>
<span class="term">
<code class="literal">enabled</code>
</span>
</dt>
<dd>
(boolean)
If true, enables calculation and storage of the model bounds for each entity
that is being analyzed. By default, this is not enabled.
</dd>
</dl>
</div>
</div>
</details>
</dd>
<dt>
<span class="term">
<code class="literal">model_snapshot_retention_days</code>
</span>
</dt>
<dd>
(long)
Advanced configuration option. The period of time (in days) that model snapshots
are retained. Age is calculated relative to the timestamp of the newest model
snapshot. The default value is <code class="literal">1</code>, which means snapshots that are one day
(twenty-four hours) older than the newest snapshot are deleted.
</dd>
<dt>
<span class="term">
<code class="literal">renormalization_window_days</code>
</span>
</dt>
<dd>
<p>
(long)
Advanced configuration option. The period over which adjustments to the score
are applied, as new data is seen. The default value is the longer of 30 days or
100 <code class="literal">bucket_spans</code>.
</p>
<div class="note admon">
<div class="icon"></div>
<div class="admon_content">
<p>If the job is open when you make the update, you must stop the datafeed,
close the job, then reopen the job and restart the datafeed for the changes to take effect.</p>
</div>
</div>
</dd>
<dt>
<span class="term">
<code class="literal">results_retention_days</code>
</span>
</dt>
<dd>
(long)
Advanced configuration option. The period of time (in days) that results are
retained. Age is calculated relative to the timestamp of the latest bucket
result. If this property has a non-null value, once per day at 00:30 (server
time), results that are the specified number of days older than the latest
bucket result are deleted from Elasticsearch. The default value is null, which means all
results are retained.
</dd>
</dl>
</div>
</div>

<div class="section">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="ml-update-job-example"></a>Examples<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/ml/anomaly-detection/apis/update-job.asciidoc">edit</a>
</h3>
</div></div></div>
<div class="pre_wrapper lang-console">
<pre class="programlisting prettyprint lang-console">POST _ml/anomaly_detectors/low_request_rate/_update
{
  "description":"An updated job",
  "detectors": {
    "detector_index": 0,
    "description": "An updated detector description"
  },
  "groups": ["kibana_sample_data","kibana_sample_web_logs"],
  "model_plot_config": {
    "enabled": true
  },
  "renormalization_window_days": 30,
  "background_persist_interval": "2h",
  "model_snapshot_retention_days": 7,
  "results_retention_days": 60
}</pre>
</div>
<div class="console_widget" data-snippet="snippets/1842.console"></div>
<p>When the anomaly detection job is updated, you receive a summary of the job
configuration information, including the updated property values. For example:</p>
<div class="pre_wrapper lang-js">
<pre class="programlisting prettyprint lang-js">{
  "job_id" : "low_request_rate",
  "job_type" : "anomaly_detector",
  "job_version" : "7.5.1",
  "groups" : [
    "kibana_sample_data",
    "kibana_sample_web_logs"
  ],
  "description" : "An updated job",
  "create_time" : 1578101716125,
  "finished_time" : 1578101721816,
  "analysis_config" : {
    "bucket_span" : "1h",
    "summary_count_field_name" : "doc_count",
    "detectors" : [
      {
        "detector_description" : "An updated detector description",
        "function" : "low_count",
        "detector_index" : 0
      }
    ],
    "influencers" : [ ]
  },
  ...
}</pre>
</div>
</div>

</div>
<div class="navfooter">
<span class="prev">
<a href="ml-update-filter.html">« Update filter API</a>
</span>
<span class="next">
<a href="ml-update-snapshot.html">Update model snapshots API »</a>
</span>
</div>
</div>

                  <!-- end body -->
                </div>
                <div class="col-xs-12 col-sm-4 col-md-4" id="right_col">
                  <div id="rtpcontainer" style="display: block;">
                    <div class="mktg-promo">
                      <h3>Most Popular</h3>
                      <ul class="icons">
                        <li class="icon-elasticsearch-white"><a href="https://www.elastic.co/webinars/getting-started-elasticsearch?baymax=default&amp;elektra=docs&amp;storm=top-video">Get Started with Elasticsearch: Video</a></li>
                        <li class="icon-kibana-white"><a href="https://www.elastic.co/webinars/getting-started-kibana?baymax=default&amp;elektra=docs&amp;storm=top-video">Intro to Kibana: Video</a></li>
                        <li class="icon-logstash-white"><a href="https://www.elastic.co/webinars/introduction-elk-stack?baymax=default&amp;elektra=docs&amp;storm=top-video">ELK for Logs &amp; Metrics: Video</a></li>
                      </ul>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </section>

        </div>


<div id="elastic-footer"></div>
<script src="https://www.elastic.co/elastic-footer.js"></script>
<!-- Footer Section end-->

      </section>
    </div>

<script src="/guide/static/jquery.js"></script>
<script type="text/javascript" src="/guide/static/docs.js"></script>
<script type="text/javascript">
  window.initial_state = {}</script>
  </body>
</html>
